<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<script type="text/javascript" src="<?php  echo $_W['siteroot'];?>addons/hx_showcp/template/style/js/ToolTip.js"></script>
<script type="text/javascript" src="http://cdn.bootcss.com/twitter-bootstrap/3.2.0/js/tooltip.min.js"></script>
<div class="main">
<ul class="nav nav-tabs">
	<li class="active"><a href="">照片管理</a></li>
</ul>
	<div style="padding:15px;">
		<form action="" method="post">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th align="center" style="width:20px;text-align:center;">ID</th>
					<th align="center" style="width:40px;text-align:center;">SN</th>				
                    <th align="center" style="width:40px;text-align:center;">姓名</th>
					<th align="center" style="width:50px;text-align:center;">手机号</th>
					<th align="center" style="width:30px;text-align:center;">阅读数</th>
					<th align="center" style="width:40px;text-align:center;">参加时间</th>
					<th align="center" style="width:40px;text-align:center;">状态</th>
					<th align="center" style="width:40px;text-align:center;">奖品名称</th>
					<th style="width:20px;text-align:center;">兑奖</th>
				</tr>
			</thead>
			<tbody>
				<?php  if(is_array($list)) { foreach($list as $row) { ?>
				<?php  $profile = mc_fetch($row['openid']);?>
					<tr>		
						<td align="center" style="text-align:center;"><?php  echo $row['id'];?></td>
						<td align="center" style="text-align:center;"><?php  if($row['status'] == 1) { ?>暂无<?php  } else { ?><?php  echo $row['sn'];?><?php  } ?></td>
                        <td align="center" style="text-align:center;"><?php  if(empty($profile['realname'])) { ?>暂无<?php  } else { ?><?php  echo $profile['realname'];?><?php  } ?></td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;"><?php  echo $profile['mobile'];?></td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;"><?php  echo $row['hits'];?></td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;"><?php  echo date('Y/m/d H:i:s',$row['createtime'])?></td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;">
							<?php  if($row['status'] == 3) { ?><span class="label label-success">已兑奖</span><?php  } ?>
							<?php  if($row['status'] == 2) { ?><span class="label label-info">已中奖</span><?php  } ?>
							<?php  if($row['status'] == 1) { ?><span class="label label-default">正常</span><?php  } ?>
						</td>
						<td align="center" style="font-size:12px; color:#666; text-align:center;"><?php  if($row['status'] == 1) { ?>暂无<?php  } else { ?><?php  echo $prizes[$row['prizeid']]['prizename'];?><?php  } ?></td>
						<td style="text-align:center;">
							<?php  if($row['status'] == 2) { ?>
							<a href="<?php  echo $this->createWebUrl('logs',array('op'=>'setstatus','reply_id'=>$reply_id,'log_id'=>$row['id']))?>"><button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="bottom" title="兑奖"><i class="fa fa-file"></i></button></a>
							<?php  } else { ?>
							无
							<?php  } ?>
						</td>
					</tr>
				<?php  } } ?>
			</tbody>
		</table>
	</form>
		<?php  echo $pager;?>
	</div>
</div>
<script type="text/javascript">
function drop_confirm(msg, url){
    if(confirm(msg)){
        window.location = url;
    }
}
$(function () {
  $('[data-toggle="tooltip"]').tooltip()
})
</script>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>
